import request from '@/plugins/request';

/**
 * @description 逛逛分类 -- 列表
 */
export function communityCategoryListApi(data) {
  return request({
    url: 'community/category',
    method: 'get',
    params: data
});
}
/**
 * @description 逛逛分类 -- 新增表单
 */
export function communityCategoryCreateApi() {
  return request({
      url: `community/category/create`,
      method: 'GET'
  });
}
/**
 * @description 逛逛分类 -- 编辑表单
 */
export function communityCategoryUpdateApi(id) {
  return request({
      url: `community/category/${id}/edit`,
      method: 'GET'
  });
}
/**
 * @description 逛逛分类 -- 修改状态
 */
export function communityCategoryStatusApi(id, status) {
  return request({
      url: `community/category/set_status/${id}/${status}`,
      method: 'PUT'
  });
}
/**
 * @description 逛逛话题 -- 列表
 */
export function communityTopicListApi(data) {
  return request({
      url: 'community/topic',
      method: 'get',
      params: data
  });
}
/**
 * @description 逛逛话题 -- 新增表单
 */
export function communityTopicCreateApi() {
  return request({
      url: `community/topic/create`,
      method: 'GET'
  });
}
/**
 * @description 逛逛话题 -- 编辑表单
 */
export function communityTopicUpdateApi(id) {
  return request({
      url: `community/topic/${id}/edit`,
      method: 'GET'
  });
}
/**
 * @description 逛逛话题 -- 修改状态
 */
export function communityTopicStatusApi(id, status) {
  return request({
      url: `community/topic/set_status/${id}/${status}`,
      method: 'PUT'
  });
}
/**
 * @description 逛逛话题 -- 修改状态
 */
 export function communityTopicHotApi(id, status) {
  return request({
      url: `community/topic/set_hot/${id}/${status}`,
      method: 'PUT'
  });
}
/**
 * @description 逛逛文章 -- 列表
 */
export function communityListApi(data) {
  return request({
      url: 'community/index',
      method: 'get',
      params: data
  });
}
/**
 * @description 逛逛文章 -- 详情
 */
export function communityDetailApi(id) {
  return request({
      url: `community/detail/${id}`,
      method: 'GET'
  });
}
/**
 * @description 逛逛文章 -- 审核/下架
 */
export function communityAuditApi(id, data) {
  return request({
      url: `community/status/${id}`,
      method: 'post',
      params: data
  });
}
/**
 * @description 逛逛文章 -- 编辑星级
 */
 export function communityUpdateApi(id) {
    return request({
      url: `community/update/${id}`,
      method: 'GET'
  });
}
/**
 * @description 逛逛文章 -- 编辑状态
 */
 export function communityStatusApi(id, status) {
  return request({
      url: `community/set_show/${id}/${status}`,
      method: 'get'
  });
}
/**
 * @description 逛逛文章 -- 是否推荐
 */
 export function communityHotApi(id) {
  return request.post(`community/hot/${id}`)
}

/**
 * @description 逛逛文章 -- 强制下架
 */

 export function communityOffApi(id) {
    return request({
      url: `community/status/${id}`,
      method: 'GET'
  });
}
/**
 * @description 逛逛文章 -- 分类筛选
 */

 export function communityCateOptionApi() {
  return request({
      url: `community/category/option`,
      method: 'GET'
  });
}
/**
 * @description 逛逛文章 -- 话题筛选
 */

 export function communityTopicOptionApi() {
  return request({
      url: `community/topic/option`,
      method: 'GET'
  });
}
/**
 * @description 逛逛评论 -- 列表
 */
 export function communityReplyListApi(data) {
  return request({
      url: `community/reply/lst`,
      method: 'GET',
      params: data
  });
}
/**
 * @description 逛逛评论 -- 删除
 */
 export function communityReplyDeleteApi(id) {
  return request({
      url: `community/reply/delete/${id}`,
      method: 'delete'
  });
}
/**
 * @description 逛逛评论 -- 审核
 */
 export function communityReviewApi(id) {
    return request({
      url: `community/reply/status/${id}`,
      method: 'GET'
  });
}
/**
 * @description 逛逛内容 -- 标题切换
 */
 export function communityTitleApi() {
  return request({
      url: `community/title`,
      method: 'GET'
  });
}

/**
 * @description 供应商申请列表
 * @param {Number} param id {Number} 
 */
export function getApplyList(data) {
  return request({
      url: `/community/apply/list`,
      method: 'get',
      params: data
  })
};

/**
 * @description 供应商审核表单
 * @param {Number} param id {Number}
 */
export function getVerifyForm(id) {
  return request({
      url: `/community/apply/verify/form/${id}`,
      method: 'get'
  })
};

/**
 * @description 供应商备注表单
 * @param {Number} param id {Number}
 */
export function getMarkForm(id) {
  return request({
      url: `/community/apply/mark/form/${id}`,
      method: 'get'
  })
};